package net.dopan.pigframe.demo.model.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldStrategy;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import net.dopan.pigframe.core.base.entity.BaseEntityWithId;

import java.io.Serializable;

/**
 * @Package: net.dopan.pigframe.demo.model.entity
 * @Title: RoleDemo
 * @Description:
 * @author: 刘宽
 * @date: 2018/10/18 14:32
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("demo_role")
public class RoleDemo extends BaseEntityWithId {

    @TableField(value = "user_id", strategy = FieldStrategy.NOT_NULL)
    private Long userId;

    @TableField(value = "role_name", strategy = FieldStrategy.NOT_NULL)
    private String roleName;

    @JsonIgnore
    @TableField(value = "mark")
    private String mark;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
